<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class CreateVipTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('vip', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('uid')->comment('uid')->detault(0);
            $table->string('vip_card_sn')->comment('会员卡卡号')->detault('');
            $table->string('shop_name')->comment('所属店铺')->detault('');
            $table->integer('shop_id')->comment('所属店铺id')->detault(0);
            $table->integer('partner_uid')->comment('上级uid')->detault(0);
            $table->tinyInteger('vip_card_status')->comment('会员卡状态 0未绑定 1已绑定 2 已禁用 ')->detault(0);
            $table->timestamp('created_at')->comment('创建时间')->default(DB::raw('CURRENT_TIMESTAMP'));
            $table->timestamp('updated_at')->comment('修改时间')->default(DB::raw('CURRENT_TIMESTAMP'));
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('vip');
    }
}
